var express = require('express');
var router = express.Router();

// 定义网站主页的路由
router.get('/error', () => {
    throw Error("This is a Error")
})

router.get('/', function(req, res, next) {
    var data = {}
    data.value =
        [
            {
                id: 1,
                title: "Learn 2 svue js",
                completed: false
            },
            {
                id: 2,
                title: "Go to shop",
                completed: false
            }
    ]
    next(data)
});

module.exports = router